// 每个a标签的鼠标移入事件
var liArr = document.querySelectorAll("nav li");
for(var i = 0; i < liArr.length; i++) {
	liArr[i].onmouseover = function() {
		var thisChildren = this.children;
		if(thisChildren.length > 0) {
			thisChildren[0].style.color = "yellow";
		}
		if(thisChildren.length > 2) {
			thisChildren[2].style.display = "block";
		}
	}
	liArr[i].onmouseout = function() {
		var thisChildren = this.children;
		if(thisChildren.length > 0) {
			thisChildren[0].style.color = "white";
		}
		if(thisChildren.length > 2) {
			thisChildren[2].style.display = "none";
		}
	}
}
$("#center>ul>li").each(function(){
	$(this).on("mouseover",function(){
		$(this).css("color","#349A48");
	})
	$(this).on("mouseout",function(){
		$(this).css("color","#b69c16");
	})
})
$("#center>ul>li").eq(0).on("click",function(){
			$("#center>ul>li").each(function(){
					$(this).removeClass("line-down");
				})
			$(this).addClass("line-down");
			$("#one").css("display","block");
			$("#two").css("display","none");
			$("#three").css("display","none");
			$("#four").css("display","none");
})
$("#center>ul>li").eq(1).on("click",function(){
			$("#center>ul>li").each(function(){
					$(this).removeClass("line-down");
				})
			$(this).addClass("line-down");
			$("#one").css("display","none");
			$("#two").css("display","block");
			$("#three").css("display","none");
			$("#four").css("display","none");
})
$("#center>ul>li").eq(2).on("click",function(){
			$("#center>ul>li").each(function(){
					$(this).removeClass("line-down");
				})
			$(this).addClass("line-down");
			$("#one").css("display","none");
			$("#two").css("display","none");
			$("#three").css("display","block");
			$("#four").css("display","none");
})
$("#center>ul>li").eq(3).on("click",function(){
			$("#center>ul>li").each(function(){
					$(this).removeClass("line-down");
				})
			$(this).addClass("line-down");
			$("#one").css("display","none");
			$("#two").css("display","none");
			$("#three").css("display","none");
			$("#four").css("display","block");
})
// 下面小图的hover效果
var oneImgArr = ["../../img/home_cn/home-box-1_CN.jpg", "../../img/home_cn/home-box-1_CN_hover.jpg"];
var twoImgArr = ["../../img/home_cn/home-box-2_CN.jpg", "../../img/home_cn/home-box-2_CN_hover.jpg"];
var threeImgArr = ["../../img/home_cn/home-box-3_CN.jpg", "../../img/home_cn/home-box-3_CN_hover.jpg"];
var fourImgArr = ["../../img/home_cn/weibo_CN.jpg", "../../img/home_cn/weibo_CN_hover.jpg"];
var fiveImgArr = ["../../img/home_cn/weixin_CN.jpg", "../../img/home_cn/weixin_CN_hover.jpg"];
$(".smallImg1").eq(0).hover(function() {
	$(this).prop("src", oneImgArr[1]);
}, function() {
	$(this).prop("src", oneImgArr[0]);
})
$(".smallImg1").eq(1).hover(function() {
	$(this).prop("src", twoImgArr[1]);
}, function() {
	$(this).prop("src", twoImgArr[0]);
})
$(".smallImg1").eq(2).hover(function() {
	$(this).prop("src", threeImgArr[1]);
}, function() {
	$(this).prop("src", threeImgArr[0]);
})
$(".smallImg2").eq(0).hover(function() {
	$(this).prop("src", fourImgArr[1]);
}, function() {
	$(this).prop("src", fourImgArr[0]);
})
$(".smallImg2").eq(1).hover(function() {
	$(this).prop("src", fiveImgArr[1]);
	$("#twoWeiMa").css("display", "block");
}, function() {
	$(this).prop("src", fiveImgArr[0]);
	$("#twoWeiMa").css("display", "none");
})
// 国际化点击事件
function sel(ev){
	if(ev.value == "CN" || ev.value == "select"){
		setThing(chinaObj);
	}
	if(ev.value == "EN"){
		setThing(enObj);
	}
}
function setThing(obj){
		$("#China").html(obj.country);
		$("#linkWorld").html(obj.linkW);
		$(".head-line-a").each(function(ind){
			$(this).html(obj.topNav[ind]);
		})
		$(".childA").each(function(ind){
			$(this).html(obj.slideNav[ind]);
		})
		titleArr = obj.aArr;
		$(".title").eq(0).prop("src",obj.aArr[0]);
		descArr = obj.bArr;
		$(".descripe").eq(0).prop("src",obj.bArr[0]);
		oneImgArr = obj.cArr;
		$(".smallImg1").eq(0).prop("src",obj.cArr[0]);
		twoImgArr = obj.dArr;
		$(".smallImg1").eq(1).prop("src",obj.dArr[0]);
		threeImgArr = obj.eArr;
		$(".smallImg1").eq(2).prop("src",obj.eArr[0]);
		fourImgArr = obj.fArr;
		$(".smallImg2").eq(0).prop("src",obj.fArr[0]);
		fiveImgArr = obj.gArr;
		$(".smallImg2").eq(1).prop("src",obj.gArr[0]);
		$(".footer").each(function(ind){
			$(".footer").eq(ind).html(obj.hArr[ind]);
		})
	}
setThing(chinaObj);// 默认调用中文显示